package com.woniu.controller;

import com.woniu.entity.ExamItem;
import com.woniu.entity.SurgeryItem;
import com.woniu.service.SurgeryItemService;
import com.woniu.utils.ResponseUtil;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController
@RequestMapping("/surgeryItem")
public class SurgeryItemController {
    @Resource
    private SurgeryItemService surgeryItemService;
    @GetMapping("/findAll")
    public ResponseUtil selectAll(@RequestParam Integer pageNum, @RequestParam Integer pageSize){
        return surgeryItemService.selectAll(pageNum,pageSize);
    }
    @GetMapping("/list")
    public ResponseUtil selectByCondition(@RequestParam(required = false) String itemName,@RequestParam(required = false) String roomName,@RequestParam(required = false) Integer status,@RequestParam Integer pageNum,@RequestParam Integer pageSize){
        return surgeryItemService.selectByCondition(itemName,roomName,status,pageNum,pageSize);
    }
    @PostMapping("/del")
    public ResponseUtil updateSurgery(Integer id){
        return surgeryItemService.updateSurgery(id);
    }
    @PostMapping("/insert")
    public ResponseUtil insertSelective(@RequestBody SurgeryItem record){
        return surgeryItemService.insertSelective(record);
    }
    @PostMapping("/update")
    public ResponseUtil updateByPrimaryKeySelective(@RequestBody SurgeryItem record){
        return surgeryItemService.updateByPrimaryKeySelective(record);
    }
    @GetMapping("/selectAll")
    public ResponseUtil findAll(){
        return surgeryItemService.findAll();
    }
}
